Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cranelift: simplify fneg(fneg(x)) to x #6034

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

Kmeakin
Copy link
Contributor

@Kmeakin Kmeakin commented Mar 16, 2023

algebraic.isle includes rewrites for cancelling fnegs when used as arguments to fma, but not for fneg cancelling itself

Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

(For completeness, I believe this is safe even on FP because the sign bit is separate from all others, so we have e.g. NaN and -NaN, and inf and -inf; everything is negatable, I think, and so this identity holds.)

@cfallin cfallin enabled auto-merge March 16, 2023 20:14
@cfallin cfallin added this pull request to the merge queue Mar 16, 2023
@alexcrichton alexcrichton removed this pull request from the merge queue due to a manual request Mar 16, 2023
@alexcrichton alexcrichton added this pull request to the merge queue Mar 16, 2023
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Mar 16, 2023
Merged via the queue into bytecodealliance:main with commit d479951 Mar 17, 2023
@Kmeakin Kmeakin deleted the double-fneg branch March 17, 2023 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants